section.refill {
  @include clearfix;
  margin-bottom: 2em;
  padding-bottom: 1em;
  position: relative;

  > h3 {
    margin-bottom: 1.3em;
    margin-top: 1em;
    padding-top: 0.5em;
  }
}

.refills-wrapper {
  @include outer-container($refills-max-width);
  padding: 1em;

  h1.main-header {
    background-color: $refills-color;
    display: inline-block;
    padding: 0.5em;
  }
}

.refill-centering {
  text-align: center;

  & > * {
    display: inline-block;

    & > * {
      text-align: left;
    }
  }

  script {
    display: none;
  }
}

.line-behind-text {
  border-bottom: 1px solid #cacaca;
  margin-bottom: 4.5em;
  text-align: center;
}

.line-behind-text h6 {
  background: $refills-body-background-color;
  color: #808080;
  display: inline-block;
  font-family: $refills-narrow-sans;
  font-size: 1em;
  font-weight: 500;
  padding: 0 10px;
  position: relative;
  text-transform: uppercase;
  top: 34px;
}

.refill h6 {
  margin-bottom: 1.5em;
}

.js-hide-code,
.js-show-code {
  border-top: 1px dashed #bebcbc;
  color: #7e7a7a;
  font-size: 0.8em;
  text-transform: uppercase;
  width: 9em;

  &:hover {
    color: $refills-accent-color;
  }
}

.js-show-code {
  display: inline-block;
  padding: 0.5em 1em;
}

.js-hide-code {
  display: none;
  padding: 0.5em 1em;
}


.refill-control {
  display: block;
  margin-bottom: 2em;
  text-align: center;
  width: 100%;

  a {
    line-height: 1.5em;
    text-decoration: none;
  }

}

.refill-snippet {
  margin-top: 4.5em;
  padding: 0 1em;

  table {
    border-collapse: collapse;
    margin: (1.5em / 2) 0;
    table-layout: fixed;
    width: 100%;
  }

  th {
    font-weight: bold;
    padding: (1.5em / 2) 0;
    text-align: left;
  }

  td {
    padding: (1.5em / 2) 0;
  }

  tr,
  td,
  th {
    vertical-align: middle;
  }
}

pre[class*="language-"] {
  background-color: #f8f8f8;
  border-top: 2px solid silver;
  height: 300px;
  line-height: 1em;
}

.snippets-table {
  display: none;

  td {
    border-bottom: 0;
  }

  .snippet:nth-child(4n) {
    display: none;
  }
}

.snippet {
  @include media($refills-medium-screen) {
    margin-bottom: 2em;
  }

  .copy-source-container {
    min-height: 3.4em;

    @include media($refills-medium-screen) {
      min-height: 2.5em;
    }

    @include media($refills-large-screen) {
      min-height: 1em;
    }
  }

  &:nth-of-type(1) .copy-source {
    background: #e98065;
  }

  &:nth-of-type(2) .copy-source {
    background: #55a1d4;
  }

  &:nth-of-type(3) .copy-source:nth-of-type(1) {
    background: #e9c05b;
  }

  &:nth-of-type(3) .copy-source:nth-of-type(2) {
    background: #89b981;
  }

  .copy-source {
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 0;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    color: #fff;
    display: inline-block;
    font-size: 0.5em;
    font-weight: 800;
    padding: 0.4em 1em;
    text-transform: uppercase;

    &:hover,
    &:active {
      background-color: lighten(#333, 20%);
      color: #fff;
    }
  }

  a {
    text-decoration: none;
  }

  code {
    font-size: 0.6em;
    line-height: 1.4em;
    max-height: 25em;
    overflow: scroll;
  }
}

.refill-smaller {
  margin: auto;
  width: 70%;
}
